☁️ Loving our new documentation website? Provide feedback in the CloudCannon Community! ✨

default_content_file

Table of contents

Description:

This key defines which file CloudCannon should use to populate a file created with an option in the + Add button dropdown.

The value is a string that specifies a file path relative to the root of your repository. This file is used to populate the initial contents of a new file if the Collection defined in add_options.collection has no Schemas configured.

The add_options.schema key will override default_content_file if configured.

Appears in:
└── collections_config
    └── *
        └── add_options
            └── [*]
                └── Add Option
                    └── default_content_file
Type:
string
Examples:

In this example, we want CloudCannon to populate the initial contents of new files with event_template.yml.

Copied to clipboard
collections_config:
  events:
    add_options:
      name: Add new event
      collection: upcoming_events
      default_content_file: event_template.yml
{
  "collections_config": {
    "events": {
      "add_options": {
        "name": "Add new event",
        "collection": "upcoming_events",
        "default_content_file": "event_template.yml"
      }
    }
  }
}
Open in a new tab